NOTE: This circuit is designed for extremely low level voltages in the nano and microvolt range.  If your sensor outputs a voltage in the high millivolt range or volt range you will need to change the gain of the first stage op amp (LTC1052 with a gain set at 1000 as shown in this schematic) and adjust the code gain to low numbers such as "GAIN = 1;"  to start. Since the second op amp has a biased output of 2.5 volts with a zero volt input on pin 2, The code variable OFFSET will need to be adjusted to calibrate your ADC reading to agree with your sensor reading. In this schematic, the ADC sees 2.5 volts as the zero point (half way between zero and + 5 volts) and will add your signal to 2.5 volts. So if your signal is + 0.3 volts, the ADC output will be 2.5 + 0.3 or 2.8 volts.
By setting the offset in the code to make the 2.5 volt ADC output read zero, you would then read your 0.3 volt input as  0.3 output from the ADC.  The same is true of negative voltages up to -2.5 volts. Any signal or sensor voltage greater than ± 2.5 volts  will simply read 5 volts or zero volts out of the ADC. The second op amp is single ended and will go to its rails with input voltages greater than   ± 2.5 volts. The good news it that you will probably not damage the ADC with a reasonable over voltage.

Working Arduino code is below the schematic.



 CODE  TO USE WITH THIS SCHEMATIC...

Copy the code between the page lines (below this line to the next line) and enter the code into a new Arduino program  blank page. It is critical that the libraries are added to the program just as they appear in this sample code. This code does not supply the libraries, the "Linduino" libraries must be downloaded as the text below describes.

start copy from the

"/*"


through and including the line:
 


 } //end ADC read and output loop


Begin Code below this line


/*

Schäfer Code
Version 1.1
13 Sep 2014

This code is written by Stefan Schafer of Heidelberg University,
Institute of Environmental Physics. This is an open source code and available
for any NON-COMMERCIAL application. Any proposed commercial use of this code is
allowed only with written permission of Stefan Schafer. Stefan's amateur radio call sign is DK7FC

The Original full code, from which this code below was developed, access to the
Linduino libraries, the use of the LTC Linduino libraries, and LTC license statements can
be found on this LTC page:

http://www.linear.com/solutions/linduino

Download the LTC Linduino libraries here:

Download the Linduino Library (Library only - please follow Quick Start Guide for instructions on install)

This will download a file called LTSketchbook.zip - This file holds all the necessary Arduino
libraries to run this code, below.

We are all extremely grateful for the cooperative work to create this library and code
between Arduino and Linear Technologies. This contribution by Linear Technologies will
enhance the Arduino community and independent developers for many years to come.

This code below was adapted by Stefan Schafer for use on this LTC2440 applications page.

>>> CRITICAL NOTE: To control SDI pin 7, connect the LTC2440 ADC SDI pin 7 to Arduino pin 11 <<<

*/



#include <Wire.h>                                      //had to add separately
#include <QuikEval_EEPROM.h>                 //from Linduino library
#include <LTC2440.h>                              //from Linduino library
#include <UserInterface.h>                       //from Linduino library
#include <LTC24XX_general.h>                //from Linduino library
#include <LT_SPI.h>                                  //from Linduino library
#include <Linduino.h>                              //from Linduino library
#include <LT_I2C.h>                                 //from Linduino library
#include <arduino.h>
#include <stdint.h>                                 //from Linduino library?
#include <SPI.h>

static int16_t OSR_mode = LTC2440_OSR_128; // here type values from 2^6 to 2^15, i.e.: 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768
                                                            // In this particular code line the 128 in LTC2440_OSR_128
                                                            // will yield a sample rate of 18 SPS

static float LTC2440_vref = 5.0;                         // Vref is the "reference" voltage supplied to the LTC2440 ADC
                                                                             // Vref/2 seems to give a wider neg dynamic range under 2.5 volts at Pin 5
const int nsamples = 50;                                   // number of data point averages - was 100
                                                                         // which gives lower noise levels
float GAIN=1;                                                     // if you are not sure make this number "1.0" to start
                                                                            // with seismic readings in microvolts, this Gain can be as high as 10000
                                                                            //(or shift decimal FIVE places to the left)
float OFFSET=0;                                                 // if you are not sure make this number "0.0" to start

float Volts_Out=0;                                             // ADC - Arduino board output in volts

// IMPORTANT NOTE: To control pin 7, connect the LTC2440ADC SDI (pin 7) to Arduino pin 11

void setup()
    {
        quikeval_SPI_init(); // Configure the spi port for 4MHz SCK
        quikeval_SPI_connect(); // Connect SPI to main data port
        Serial.begin(115200); // Initialize and set baud rate for the serial port to the PC
    }

void loop()
    { //begin ADC read and output loop

       uint8_t adc_command; // The LTC2440 command word
       int32_t adc_code = 0; // The LTC2440 code
       float adc_voltage = 0; // The LTC2440 voltage
       float adc_summe = 0; // sum of voltages in for-loop
       float adc_average = 0; // averaged voltage after for-loop
       uint16_t miso_timeout = 1000; // Used to wait for EOC
       int i;
       adc_command = OSR_mode; // Build the OSR command code

       for (i=0; i<nsamples; i++)

           { //Begin "for"

                   if(!LTC2440_EOC_timeout(LTC2440_CS, miso_timeout)) // Check for EOC
                       {LTC2440_read(LTC2440_CS, adc_command, &adc_code); // Throws out reading
                       adc_voltage = LTC2440_code_to_voltage(adc_code, LTC2440_vref);
                   } //End "if"

               adc_summe = adc_summe + adc_voltage;

           } //End "for"

       adc_average = adc_summe / nsamples;          // Get average value over nsamples sum
       Volts_Out = adc_average*GAIN + OFFSET;      // Allow for linear ADC voltage output calibration
      
       Serial.println(Volts_Out, 6);                            // Send Arduino Board Output from to serial USB/com port
                                                                             // to be read by PC/MAC/LINUX serial read program, input

    } //end ADC read and output loop


END CODE above this line